#基于python:3.8这个基础镜像镜像构建镜像
FROM python:3.8
#  设置环境变量
ENV PYTHONUNBUFFERED 1
ENV env production

ADD ./requirements.txt /requirements.txt

RUN pip install -r /requirements.txt --trusted-host mirrors.aliyun.com --index-url https://mirrors.aliyun.com/pypi/simple/

ADD ./entrypoint.sh /entrypoint.sh

ADD . ${WWW_ROOT}/

RUN chmod +x /entrypoint.sh

WORKDIR ${WWW_ROOT}/
ENTRYPOINT [ "/entrypoint.sh" ]
CMD ["run"]
#
##  在容器内创建/var/mydjango 文件夹
#RUN mkdir -p /var/xiuyu
## 设置容器内工作目录为 /var/mydjango
#WORKDIR /var/xiuyu
## 将当前目录下所有文件添加至Docker容器内的工作目录中
#ADD . /var/xiuyu
##安装依赖包
#RUN pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
## 对外暴露3000端口
#EXPOSE 9001
##设置容器执行后自动执行的命令
#CMD ["python3","manage.py","runserver","0.0.0.0:9001"]